package com.azkaban;

import com.alibaba.fastjson.JSONObject;
import com.azkaban.api.AzkabanApi;
import com.azkaban.proxy.AzkabanApiProxyBuilder;
import com.azkaban.response.ExecuteFlowResponse;
import lombok.extern.slf4j.Slf4j;

/**
 * @program: azkaban-java-api
 * @author: Zhoujian
 * @date: 2022-05-05 09:59
 * @version: 1.0
 * @description: 调度azkaban任务链
 **/
@Slf4j
public class ExecuteFlow {

	public static void main(String[] args) {
		AzkabanApi apis = AzkabanApiProxyBuilder.create()
				.setUri(args[0])
				.setUsername("azkaban")
				.setPassword("azkaban")
				.build();

		ExecuteFlowResponse executeFlowResponse = apis.executeFlow(args[1], args[2]);
		log.info(JSONObject.toJSONString(executeFlowResponse));
	}
}
